ggtIterative(a,b,r)
	if not (a!=0) goto AZEROdone;
	if not (b!=0) goto BZEROdone;
	LOOPdo:
	if (not (b!=0)) goto LOOPdone;
    (* while (b!=0) { *)
        var c = a;
        MODdo:
        if (b>c) goto MODdone;
        (* while (c>=b) { *)
            c = c+(-b);
		goto MODdo;
        (* } *)
        MODdone:
        a=b;
        b=c;
	goto LOOPdo;
    (* } *)
    LOOPdone:
    return a;
    AZEROdone:
    return b;
    BZEROdone:
    return a;
end;
